<?php if ($model->contest->isVotingAllowed()): ?>

	<?php if (!Yii::app()->user->isGuest): ?>

		<?php if (!$model->hasVoted(Yii::app()->user->id)): ?>
			<?php echo CHtml::link(Yii::t('frontend','VOTE'),array('entry/vote','id'=>$model->id),
					array('class'=>'btn primary large twipsify')); ?>
		<?php else: ?>
			<?php echo CHtml::link(Yii::t('frontend','VOTE'),'',
					array('class'=>'btn primary large twipsify disabled','title'=>Yii::t('frontend','You have already voted for this entry'))); ?>
		<?php endif; ?>

	<?php else: ?>

		<?php echo CHtml::link(Yii::t('frontend','VOTE'),'',
				array('class'=>'btn primary large twipsify disabled','title'=>Yii::t('frontend','You have to log in to vote'))); ?>

	<?php endif; ?>

<?php else: ?>

	<?php echo CHtml::link(Yii::t('frontend','VOTE'),'',
			array('class'=>'btn primary large twipsify disabled','title'=>Yii::t('frontend','Voting is closed for this contest'))); ?>

<?php endif; ?>